package com.hello.tong.service.impl;

import com.hello.tong.entity.Storage;
import com.hello.tong.mapper.StorageMapper;
import com.hello.tong.service.IStorageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author tong-exists
 * @since 2022-12-31
 */
@Service
@Slf4j
public class StorageServiceImpl extends ServiceImpl<StorageMapper, Storage> implements IStorageService {

    @Autowired
    private StorageMapper storageMapper;

    @Override
    public void deduct(String commodityCode, int count) {
        log.info("deduct...");
        storageMapper.updateCountByCommodityCodeInt(commodityCode, count);
    }
}
